import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const home = r => require.ensure([], () => r(require('@/components/home/home')), 'chunkname1');
const about_why = r => require.ensure([], () => r(require('@/components/about/about_why')), 'chunkname1')
const complicance = r => require.ensure([], () => r(require('@/components/about/complicance')), 'chunkname1');
const advantages = r => require.ensure([], () => r(require('@/components/about/advantages')), 'chunkname1');
const pc = r => require.ensure([], () => r(require('@/components/ourplateform/pc')), 'chunkname1');
const mobile = r => require.ensure([], () => r(require('@/components/ourplateform/mobile')), 'chunkname1');
const notice = r => require.ensure([], () => r(require('@/components/notice/notice')), 'chunkname1');
const withdraw = r => require.ensure([], () => r(require('@/components/notice/process')), 'chunkname1');
const activity = r => require.ensure([], () => r(require('@/components/activity/activity')), 'chunkname1');
// 交易指南---外汇基础知识
const guidelist = r => require.ensure([], () => r(require('@/components/guide/knowledges/list')), 'chunkname1');
const guideone = r => require.ensure([], () => r(require('@/components/guide/knowledges/one')), 'chunkname1');
const guidetwo = r => require.ensure([], () => r(require('@/components/guide/knowledges/two')), 'chunkname1');
const guidethree = r => require.ensure([], () => r(require('@/components/guide/knowledges/three')), 'chunkname1');
const guidefour = r => require.ensure([], () => r(require('@/components/guide/knowledges/four')), 'chunkname1');
const guidefive = r => require.ensure([], () => r(require('@/components/guide/knowledges/five')), 'chunkname1');
const guidesix = r => require.ensure([], () => r(require('@/components/guide/knowledges/six')), 'chunkname1');
const guideseven = r => require.ensure([], () => r(require('@/components/guide/knowledges/seven')), 'chunkname1');
const guideeight = r => require.ensure([], () => r(require('@/components/guide/knowledges/eight')), 'chunkname1');
const guidenine = r => require.ensure([], () => r(require('@/components/guide/knowledges/nine')), 'chunkname1');
const guideten = r => require.ensure([], () => r(require('@/components/guide/knowledges/ten')), 'chunkname1');
const guideeleven = r => require.ensure([], () => r(require('@/components/guide/knowledges/eleven')), 'chunkname1');
//  常见问题
const faq = r => require.ensure([], () => r(require('@/components/faq/faq')), 'chunkname1');
// 交易优势
const advantage = r => require.ensure([], () => r(require('@/components/guide/advantage/advantage')), 'chunkname1');
// 交易指南---外汇交易风险控制
const control = r => require.ensure([], () => r(require('@/components/guide/dealguide/control')), 'chunkname1');
// 交易指南---外汇交易如何操作
const operation = r => require.ensure([], () => r(require('@/components/guide/dealguide/operation')), 'chunkname1');
// 市场活动详情
const activity_one = r => require.ensure([], () => r(require('@/components/activity/activity_one')), 'chunkname1');
const activity_two = r => require.ensure([], () => r(require('@/components/activity/activity_two')), 'chunkname1');
const activity_three = r => require.ensure([], () => r(require('@/components/activity/activity_three')), 'chunkname1');
const activity_four = r => require.ensure([], () => r(require('@/components/activity/activity_four')), 'chunkname1');
const activity_five = r => require.ensure([], () => r(require('@/components/activity/activity_five')), 'chunkname1');
// 外汇基本分析
const basicanalysis = r => require.ensure([], () => r(require('@/components/guide/analysis/basicanalysis')), 'chunkname1');
const technology = r => require.ensure([], () => r(require('@/components/guide/analysis/technology')), 'chunkname1');
const icontype = r => require.ensure([], () => r(require('@/components/guide/analysis/icontype')), 'chunkname1');
// 合作伙伴
const partner = r => require.ensure([], () => r(require('@/components/partner/partner')), 'chunkname1');
const ib = r => require.ensure([], () => r(require('@/components/partner/ib')), 'chunkname1');
const organization = r => require.ensure([], () => r(require('@/components/partner/organization')), 'chunkname1');
// 外汇词汇
const FXGlossary = r => require.ensure([], () => r(require('@/components/FXGlossary/FXGlossary')), 'chunkname1');


const routes = [
    {
      path: '/',
      component: home
    },
    {
      path: '/about_why',
      component: about_why
    },
    {
      path: '/complicance',
      component: complicance
    },
    {
      path: '/advantages',
      component: advantages
    },
    {
      path: '/pc', //桌面版MT4
      component: pc
    },
    {
      path: '/mobile', //移动版MT4
      component: mobile
    },
    {
      path: '/notice', //开户须知
      component: notice
    },
    {
      path: '/withdraw', //出入金流程
      component: withdraw
    },
    {
      path: '/activity',  // 市场活动
      component: activity
    },
    {
      path: '/guidelist', // 外汇基础知识列表
      component: guidelist
    },
    {
      path: '/guideone', // 外汇基础知识(一)
      component: guideone
    },
    {
      path: '/guidetwo',
      component: guidetwo
    },
    {
      path: '/guidethree',
      component: guidethree
    },
    {
      path: '/guidefour',
      component: guidefour
    },
    {
      path: '/guidefive',
      component: guidefive
    },
    {
      path: '/guidesix',
      component: guidesix
    },
    {
      path: '/guideseven',
      component: guideseven
    },
    {
      path: '/guideeight',
      component: guideeight
    },
    {
      path: '/guidenine',
      component: guidenine
    },
    {
      path: '/guideten',
      component: guideten
    },
    {
      path: '/guideeleven', // 外汇基础知识(十一)
      component: guideeleven
    },
    {
      path: '/faq', // 常见问题
      component: faq
    },
    {
      path: '/advantage', // 交易优势
      component: advantage
    },
    {
      path: '/control', // 风险控制
      component: control
    },
    {
      path: '/operation', // 如何操作
      component: operation
    },
    {
      path: '/activity_one', // 市场活动详情一
      component: activity_one
    },
    {
      path: '/activity_two', // 市场活动详情二
      component: activity_two
    },
    {
      path: '/activity_three', // 市场活动详情三
      component: activity_three
    },
    {
      path: '/activity_four', // 市场活动详情四
      component: activity_four
    },
    {
      path: '/activity_five', // 市场活动详情四
      component: activity_five
    },
    {
      path: '/basicanalysis', // 基本分析
      component: basicanalysis
    },
    {
      path: '/technology', // 技术分析
      component: technology
    },
    {
      path: '/icontype', // 图表基本类型
      component: icontype
    },
    {
      path: '/partner', // 合作伙伴
      component: partner
    },
    {
      path: '/ib', // IB
      component: ib
    },
    {
      path: '/organization', // 机构合作方案
      component: organization
    },
    {
      path: '/FXGlossary', // 外汇词汇
      component: FXGlossary
    }
  ];

const router = new Router({
  routes,
  linkActiveClass: 'active',
  scrollBehavior (to, from, savedPosition) {   // 让所有的路由默认回到顶部
    return { x: 0, y: 0 }
  }
});

export default router;
